-
Notifications
You must be signed in to change notification settings - Fork 612
fix(instrumentation-aws-lambda): relax @types/aws-lambda
dependency constraint
#3168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hmm, I'll leave the decision for this up to @jj22ee. Personally, I think the better approach to solve this may be to copy the only used type ( The type that's actually used is not very simple, but it's simple enough to be copied IMO. // important: when going this route, retain the original license
/**
* MIT License
*
* Copyright (c) Microsoft Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE
*/
export interface Context {
callbackWaitsForEmptyEventLoop: boolean;
functionName: string;
functionVersion: string;
invokedFunctionArn: string;
memoryLimitInMB: string;
awsRequestId: string;
logGroupName: string;
logStreamName: string;
identity?: {
cognitoIdentityId: string;
cognitoIdentityPoolId: string;
};
clientContext?: {
client: {
installationId: string;
appTitle: string;
appVersionName: string;
appVersionCode: string;
appPackageName: string;
};
Custom?: any;
env: {
platformVersion: string;
platform: string;
make: string;
model: string;
locale: string;
};
} | undefined;
tenantId?: string | undefined;
getRemainingTimeInMillis(): number;
// Functions for compatibility with earlier Node.js Runtime v0.10.42
// No longer documented, so they are deprecated, but they still work
// as of the 12.x runtime, so they are not removed from the types.
/** @deprecated Use handler callback or promise result */
done(error?: Error, result?: any): void;
/** @deprecated Use handler callback with first argument or reject a promise result */
fail(error: Error | string): void;
/** @deprecated Use handler callback with second argument or resolve a promise result */
succeed(messageOrObject: any): void;
// Unclear what behavior this is supposed to have, I couldn't find any still extant reference,
// and it behaves like the above, ignoring the object parameter.
/** @deprecated Use handler callback or promise result */
succeed(message: string, object: any): void;
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this as a first step though 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fine with this. If you do want to do the "copy the types" approach though, you can refer to this example in aws-sdk instrumentation.
failing tests are unrelated #3180 |
Which problem is this PR solving?
@types/aws-lambda
declared a global class so having different versions of the package (regardless of if the class is actually different) in the tree raises an error (see Consider unpinning@types/aws-lambda
#2965 for a real-world example of this happening)Short description of the changes
@types/aws-lambda
dependency constraint to allow minor and patch versionsResolves #2965